package server

type Err int

const (
	RequestEncodeErr Err = iota
	RequestWaitTiemedOut
	RequestQueueFull
)

var errString = map[Err]string{
	RequestEncodeErr:     "request param error",
	RequestWaitTiemedOut: "request wait timed out",
	RequestQueueFull:     "request queue full",
}

func (e Err) Error() string {
	if s, ok := errString[e]; !ok {
		panic("Invalid err type.")
	} else {
		return s
	}
}
